
<script type="text/javascript">

$(function(){
		   
	$('#formPessoa').ajaxForm({
		dataType: 'json',
		beforeSubmit: function() {
			if( $("#txtNome").val() == "" || $("#txtSobrenome").val() == "" ){
				alert("Preencha os dados corretamente!!")
				return false;
			}
			
			if( $("#txtSenha").val() != $("#txtSenhaConfirma").val()){
				alert("A senha e repita senha não são iguais!")
				return false;
			}
		},
		success: function(responseText, statusText) {
			if(responseText.sucesso){
				alert(responseText.mensagem);
			}else{
				alert(responseText.mensagem);
			}
		}

	})

	$.ajax({
		type:"POST",
		url:"actions/pessoaAction.php",
		dataType:"json",
		success: function(data, textStatus, request){
			$("#txtNome").val(data['nome']);
			$("#txtSobrenome").val(data['sobrenome']);
			$("#txtNascimento").val(data['nascimento']);
			$("#txtSexo").val(data['sexo']);	
			$("#txtFacebook").val(data['facebook']);
			$("#txtWebPage").val(data['webpage']);
			$("#txtTwitter").val(data['twitter']);
			$("#txtEmail").val(data['email']);
			$("#txtIdPessoa").val(data['id_pessoa']);
			$("#txtFacebook").val(data['facebook']);
			$("#txtwebpage").val(data['webpage']);	
			$("#txtSenha").val(data['senha']);
			$("#txtUsuario").val(data['usuario']);			
			
		}	
	});
	
	$("#content").css("height","750px");
	
	$(".exibeData").datepicker({
		dateFormat: 'dd/mm/yy', 
		buttonImage: 'img/calendario.gif',
		buttonImageOnly: true,
		nextText: 'Próximo',  
		prevText: 'Anterior' ,
		monthNames: ['Janeiro','Feveiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
		monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
		dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
		dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'] 
	});

})

function abrirMensagens(){
	
	$('#ler_msg').dialog({show: "blind",
					hide: "explode",
					width:350,
					resizable:false}); 
}

function postarVideo(){
	$('#postar_video').dialog({show: "blind",
							hide: "explode",
							width:350,
							resizable:false});
}

function mudarSenha(){
	$('#mudar_senha').dialog({show: "blind",
							hide: "explode",
							width:350,
							resizable:false});
}


</script>

<div id="formularios">

<fieldset title="teste" style="height:520px;width:800px;padding:10px;">
        <legend>
            <img src="../images/topoPaginas/Icon_Voce_Menu.png"/>
        </legend>
        <div id="btnSairForms">
        <a href="/?pg=home" title="Sair" style="border:0;">
        	<img src="images/btnOutros/btnSairForms.png"/>
        </a>
        </div>
        <div align="center"> 
        
        <form action="actions/pessoaAction.php" method="post" id="formPessoa" name="formPessoa">
        	<table width="468" border="0">
              <tr>
                <td width="144" rowspan="5"> <div style="background:url(images/btnOutros/fundoFoto.png);width:83px;height:82px;">                    </div> </td>
                <td width="144"><span id="title">Seu Login </span><span style="color:#F00;">*<br />
                    <input type="text"  id="txtUsuario" name="txtUsuario"/>
                </span></td>
                <td width="31">&nbsp;</td>
                <td colspan="2">Serie/Curso<br />
                  <select id="select" name="select">
                    <option>Selecione</option>
                  </select></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td width="65">&nbsp;</td>
                <td width="62">&nbsp;</td>
              </tr>
              <tr>
                <td><span id="title">Sua senha </span><span style="color:#F00;">*<br />
                    <input type="text"  id="txtSenha" name="txtSenha"/>
                </span></td>
                <td>&nbsp;</td>
                <td colspan="2"><span id="title">Repita sua senha </span><span style="color:#F00;">*<br />
                    <input type="text"  id="txtSenhaConfirma" name="txtSenhaConfirma"/>
                </span></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td colspan="4">&nbsp;</td>
              </tr>
              <tr>
                <td><span id="title">Primeiro Nome</span><span style="color:#F00;">*</span><br />
                  <input type="text"  id="txtNome" name="txtNome"/>
                  <input type="hidden"  id="acao" name="acao" value="edit"/>
                  <input type="hidden"  id="txtIdPessoa" name="txtIdPessoa"/></td>
                <td><span id="title">Esporte Favorito</span><br />
                  <select id="txtEsporteFavorito" name="txtEsporteFavorito">
                    <option>Selecione</option>
                  </select></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>
                    <br /></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td colspan="2"><span id="title">Sobrenome</span><span style="color:#F00;">*</span><br />
                  <input type="text"  id="txtSobrenome" name="txtSobrenome" size="50"/></td>
                <td><a href="#" title="E-mail" style="border:0;"><img src="images/btnOutros/btnEmail.png" height="22" width="22"/></a></td>
                <td><span id="title">E-mail</span><br />
                  <input type="text"  id="txtEmail" name="txtEmail"/></td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><span id="title">Nascimento</span><br />
                  <input type="text"  id="txtNascimento" name="txtNascimento" class="exibeData"/></td>
                <td><span id="title">Sexo</span><br />
                  <input type="radio" id="txtSexo2" name="txtSexo" value="M"/>
                  <img src="images/btnOutros/masculino.png"/>
                  <input type="radio" id="txtSexo" name="txtSexo" value="F"/>
                  <img src="images/btnOutros/feminino.png"/> </td>
                <td><a href="/pg=home" title="Home" style="border:0;"><img src="images/btnOutros/btnHome.png" height="22" width="22"/></a></td>
                <td><span id="title">WebPage</span><br />
                  <input type="text"  id="txtWebPage" name="txtWebPage"/></td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td><a href="#" title="Twitter" style="border:0;"><img src="images/btnOutros/btnTwitter.png" height="22" width="22"/></a></td>
                <td><span id="title">Twitter</span><br />
                  <input type="text"  id="txtTwitter" name="txtTwitter"/></td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td><a href="#" title="Facebook" style="border:0;"><img src="images/btnOutros/btnFacebook.png" height="22" width="22"/></a></td>
                <td><span id="title">Facebook</span><br />
                  <input type="text"  id="txtFacebook" name="txtFacebook"/></td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table>

          </form> 
      </div>
    </fieldset>
    
    <div style="position:relative;width:800px;height:40px;text-align:right;padding-right:10px;font-size:10px;color:#F00;">
    	* Campos de preenchimento Obrigatório    
    </div>
    
    <div style="position:relative;width:800px;height:40px;text-align:center;">
    	<a href="javascript:void(0);" title="Salvar Alterações" onclick="$('#formPessoa').submit()" style="border:0;text-decoration:none;padding-left:12px;">
            <img src="images/btnOutros/btnSalvar.png" />
        </a>
    </div>

</div>


<!-- ----------------------------------------- -->
<div style="display:none;">
    <div id='ler_msg' title='Mensagens Recebidas' style='text-align:center;width:200px;height:600px;'>
    	teste
    </div>
</div>
<!-- ----------------------------------------- -->

<!-- ----------------------------------------- -->
<div style="display:none;">
    <div id='mudar_senha' title='Mudar Senha' style='text-align:center;width:300px;height:200px;'>
    	teste
    </div>
</div>
<!-- ----------------------------------------- -->

<!-- ----------------------------------------- -->
<div style="display:none;">
    <div id='postar_video' title='Postar Video' style='text-align:center;width:400px;height:500px;'>
    	teste
    </div>
</div>
<!-- ----------------------------------------- -->